﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Utilities
{
    public static class ExtensionsGuid
    {
        public static bool IsValid(this Guid id)
        {
            if (id == Guid.Empty) return false;
            else return true;
        }

        public static bool IsValid(this Guid? id)
        {
            if (id == null) return false;
            else return id.Value.IsValid();
        }

        public static void me_IsValidThrowExceptions(this Guid id)
        {
            if (!id.IsValid()) throw new EmptyGuidException();
        }
    }
}
